<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test24</title>
</head>
<body>
    <script type="text/javascript">
        COUNT();
        function COUNT() {
            var arr = [3,4,3,5,7,9];
            var count = 0;
            for(var i = 0; i<arr.length; i++){
                if (arr[i]==3){
                    count++;
                }
            }
            alert("3在数组中出现了"+count+"次");
        }
    </script>
</body>
</html>